# Xenomorph megacorp branch-office holdings.
# 3_61: @med_trade_from_jobs was referenced but never defined (error.log T4).
# Value = LV's per-job trade-add constant (@trade_value_from_jobs, lv_branch_office_buildings.txt:9).
@med_trade_from_jobs = 0.01

# Corporate empires with the relevant Xeno civic can build these on planets where they hold a branch office.

# Pleasure Den — unlocked by civic_xeno_pleasure_products. Sells brood-trained pleasure assets for Trade.
building_xenomorph_pleasure_den = {
	icon = building_lv_brothel
	base_buildtime = @b1_time
	planet_limit = 1
	owner_type = corporate
	category = amenity

	potential = {
		has_branch_office = yes
		branch_office_owner = { has_civic = civic_xeno_pleasure_products }
		is_artificial = no
		NOR = {
			is_planet_class = pc_hive
			is_planet_class = pc_machine
			is_planet_class = pc_city
		}
	}

	resources = {
		category = planet_branch_office_buildings
		inline_script = {
			script = buildings/nomadic_cost_switcher
			REGULAR_RESOURCE = minerals
			NOMADIC_RESOURCE = alloys
			COST = 500
			NOMADIC_COST_MULT = 0.5
		}
		cost = {
			influence = 25
		}
	}

	inline_script = {
		script = jobs/entertainers_add
		AMOUNT = @building_static_jobs
	}

	custom_tooltip = branch_office_building_trade_bonus

	triggered_planet_modifier = {
		potential = { always = yes }
		planet_entertainers_trade_produces_add = @med_trade_from_jobs
	}
}

# War Leasing Office — unlocked by civic_xeno_aliens_of_war. Leases Xeno war-beasts for Trade.
building_xenomorph_war_leasing_office = {
	icon = building_hive_node
	base_buildtime = @b1_time
	planet_limit = 1
	owner_type = corporate
	category = army

	potential = {
		has_branch_office = yes
		branch_office_owner = { has_civic = civic_xeno_aliens_of_war }
		is_artificial = no
		NOR = {
			is_planet_class = pc_hive
			is_planet_class = pc_machine
			is_planet_class = pc_city
		}
	}

	resources = {
		category = planet_branch_office_buildings
		inline_script = {
			script = buildings/nomadic_cost_switcher
			REGULAR_RESOURCE = minerals
			NOMADIC_RESOURCE = alloys
			COST = 500
			NOMADIC_COST_MULT = 0.5
		}
		cost = {
			influence = 25
		}
	}

	inline_script = {
		script = jobs/soldiers_add
		AMOUNT = @building_static_jobs
	}

	custom_tooltip = branch_office_building_trade_bonus

	triggered_planet_modifier = {
		potential = { always = yes }
		planet_soldiers_trade_produces_add = @med_trade_from_jobs
	}
}
